package com.fy.fyzf.presenter;

import com.fy.fyzf.api.SubscriberCallBack;
import com.fy.fyzf.base.BasePresenter;
import com.fy.fyzf.bean.MessageSendBean;
import com.fy.fyzf.bean.RegisterBean;
import com.fy.fyzf.bean.BaseData;
import com.fy.fyzf.view.RegisterCallbaclk;

public class RegisterPresenter extends BasePresenter<RegisterCallbaclk> {
    public RegisterPresenter(RegisterCallbaclk view) {
        super(view);
    }


    public void getCode(MessageSendBean messageSendBean){
        addSubscription(mApiService.getCode(messageSendBean), new SubscriberCallBack<BaseData>(mView,true) {
            @Override
            protected void onSuccess(BaseData response) {
                mView.getCodeSuccess(response);
            }

            @Override
            protected void onError() {

            }
        });
    }


    public void toRegister(RegisterBean registerBean){
        addSubscription(mApiService.joinUs(registerBean), new SubscriberCallBack<BaseData>(mView,true) {

            @Override
            protected void onSuccess(BaseData response) {
                mView.registetrSuccess(response);
            }

            @Override
            protected void onError() {

            }
        });
    }
}
